'''
Description: 
Version: 1.0.1
Autor: hrlu.cn
Date: 2022-07-30 14:22:58
LastEditors: hrlu.cn
LastEditTime: 2022-07-30 14:22:58
'''
import datetime

import pymysql

from config import *


pymysql.install_as_MySQLdb()

try:
    datetime.datetime.strptime(DEFAULT_START_DATE, '%Y-%d-%m')
except Exception as e:
    assert False, "Constant DEFAULT_START_DATE does not have an allowed value: " + str(DEFAULT_START_DATE)

try:
    datetime.datetime.strptime(TREND_JUDGMENT_START_DATE, '%Y-%d-%m')
except Exception as e:
    assert False, "Constant TREND_JUDGMENT_START_DATE does not have an allowed value: " + str(TREND_JUDGMENT_START_DATE)

assert isinstance(EXTREME_MONITOR_INTERVAL, int) and 0 < EXTREME_MONITOR_INTERVAL < float('inf'), \
    "Constant EXTREME_MONITOR_INTERVAL does not have an allowed value: " + str(EXTREME_MONITOR_INTERVAL)